package com.squirrel.common.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.squirrel.common.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.squirrel.common.vo.user.UserInfoVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  UserMapper 用户接口
 * </p>
 *
 * @author 关远键
 * @since 2021/11/10 14:25
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    UserInfoVO getAuthorInfo(@Param("id") Integer id);

    User getUserByMailOrPhone(@Param("mail") String mail);

    Integer getByNickname(@Param("nickname") String nickname);

    // 模糊查询
    IPage<Integer> getUserIdByKey(Page<Integer> page, @Param("nickname") String nickname);

    Integer getByMail(@Param("mail") String mail);

    Integer reg(@Param("nickname") String nickname, @Param("mail") String mail, @Param("password") String password);

}
